package com.ruoyi.module.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.module.mapper.CityMapper;
import com.ruoyi.module.domain.City;
import com.ruoyi.module.service.ICityService;

/**
 * 市Service业务层处理
 *
 * @author fubojin
 * @date 2024-12-23
 */
@Service
public class CityServiceImpl implements ICityService
{
    @Autowired
    private CityMapper cityMapper;

    /**
     * 查询市
     *
     * @param id 市主键
     * @return 市
     */
    @Override
    public City selectCityById(String id)
    {
        return cityMapper.selectCityById(id);
    }

    /**
     * 查询市列表
     *
     * @param city 市
     * @return 市
     */
    @Override
    public List<City> selectCityList(City city)
    {
        return cityMapper.selectCityList(city);
    }

    /**
     * 新增市
     *
     * @param city 市
     * @return 结果
     */
    @Override
    public int insertCity(City city)
    {
        city.setCreateTime(DateUtils.getNowDate());
        return cityMapper.insertCity(city);
    }

    /**
     * 修改市
     *
     * @param city 市
     * @return 结果
     */
    @Override
    public int updateCity(City city)
    {
        return cityMapper.updateCity(city);
    }

    /**
     * 批量删除市
     *
     * @param ids 需要删除的市主键
     * @return 结果
     */
    @Override
    public int deleteCityByIds(String[] ids)
    {
        return cityMapper.deleteCityByIds(ids);
    }

    /**
     * 删除市信息
     *
     * @param id 市主键
     * @return 结果
     */
    @Override
    public int deleteCityById(String id)
    {
        return cityMapper.deleteCityById(id);
    }
}
